#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int cur = 0; int dest = -1;
        for (; cur < nums.size(); cur++)
        {
            if (nums[cur])
            {
                swap(nums[cur], nums[++dest]);
            }
        }
    }
};